package cn.icanci.loopstack.ddk.common.socket.publish;

import java.io.Serializable;
import java.util.Objects;
import java.util.StringJoiner;

/**
 * @author icanci
 * @since 1.0 Created in 2023/01/12 10:33
 */
public class PublishMethodInvokeDTO implements Serializable {
    /**
     * 通知配置资源
     */
    private String noticeResource;
    /**
     * 测试配置值，可选；因为可能通过配置值进行特殊处理
     */
    private String noticeValue;

    public PublishMethodInvokeDTO() {
    }

    public PublishMethodInvokeDTO(String noticeResource, String noticeValue) {
        this.noticeResource = noticeResource;
        this.noticeValue = noticeValue;
    }

    public String getNoticeResource() {
        return noticeResource;
    }

    public void setNoticeResource(String noticeResource) {
        this.noticeResource = noticeResource;
    }

    public String getNoticeValue() {
        return noticeValue;
    }

    public void setNoticeValue(String noticeValue) {
        this.noticeValue = noticeValue;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;
        PublishMethodInvokeDTO that = (PublishMethodInvokeDTO) o;
        return Objects.equals(noticeResource, that.noticeResource) && Objects.equals(noticeValue, that.noticeValue);
    }

    @Override
    public int hashCode() {
        return Objects.hash(noticeResource, noticeValue);
    }

    @Override
    public String toString() {
        return new StringJoiner(",").add("noticeResource=" + noticeResource).add("noticeValue=" + noticeValue).toString();
    }
}
